<section class="content-header">
	<h1> Update Employer Contact Person Form <small>Preview</small></h1>
	<ol class="breadcrumb">
		<li>
			<a href="#"><i class="fa fa-dashboard"></i> Home</a>
		</li>
		<li>
			<a href="#">Update employer contact person form</a>
		</li>
		<li class="active">
			Update employer contact person
		</li>
	</ol>
</section>
<?php
	foreach($employer_contact_person as $contact_person){
		$using_employer_id=$contact_person->using_employer_id;
		$name=$contact_person->name;
		$email=$contact_person->email;
		$phone=$contact_person->phone;
	}
?>
<form role="form" action="<?php echo base_url(); ?>control-employer-contact-persons/update-employer-contact-person/<?php echo $this->uri->segment(3);?>" method="post">
	<section class="content">
		<div class="row">
			<!-- left column -->
			<div class="col-md-6 col-md-offset-3">
				<!-- general form elements -->
				<div class="box box-primary">
					<div class="box-header">
						<h3 class="box-title">Update employer contact person</h3>
					</div><!-- /.box-header -->
					<!-- form start -->

					<div class="box-body">
						<div class="form-group">
							<label for="employer">Employer of contact person</label>
								<select name="employer" class="form-control">
									<option value="0"></option>
									<?php
										foreach($employers as $employer){
											$employer_id=$employer->employer_id;
											$employer_name=$employer->username;
											if($employer_id==$using_employer_id){
									?>
												<option value="<?php echo $employer_id;?>" selected="selected"><?php echo $employer_name;?></option>
									<?php			
											}else{
									?>
												<option value="<?php echo $employer_id;?>"><?php echo $employer_name;?></option>
									<?php
											}
										}
									?>
									
								</select>
							<?php echo form_error('employer'); ?>
						</div>
						
						<div class="form-group">
							<label for="name">Name <span class="required">*</span></label>
							<input type="text" class="form-control" id="name" name="name" placeholder=" Name" value="<?php echo $name; ?>" required="required">
							<?php echo form_error('name'); ?>
						</div>
						
						<div class="form-group">
							<label for="email">Email <span class="required">*</span></label>
							<input type="email" class="form-control" id="email" name="email" placeholder="Email" value="<?php echo $email; ?>" required="required">
							<?php echo form_error('email'); ?>
						</div>
						
						<div class="form-group">
							<label for="phone">Phone </label>
							<input type="text" class="form-control" id="phone" name="phone" placeholder="Phone" value="<?php echo $phone; ?>" required="required">
							<?php //echo form_error('phone'); ?>
						</div>

					</div><!-- /.box-body -->

					<div class="box-footer">
						<button type="submit" class="btn btn-success">
							<span class="glyphicon glyphicon-saved"></span> Submit
						</button>
					</div>

				</div><!-- /.box -->

			</div><!--/.col (left) -->
			<!-- right column -->
			
		</div>
		<!-- /.row -->
	</section><!-- /.content -->
</form>